<template>
	<view class="tab">
		
		<view class="tab-view" @click="urlClick('/pages/cell/everyday')">
			<image src="../../static/index/mei.png"></image>
			<view>每日数独</view>
		</view>
		<!-- -->
		<view class="tab-view" v-for="(item,index) in list" @click="urlClick('/pages/cell/cell?cid='+item.id)" >
			<image :src="item.img"></image>
			<view>{{item.name}}</view>
		</view>
		
		
	</view>
</template>
<!--  -->
<script>
	export default {
		
		data() {
			return {
				list   : {}
			}
		},
		created() {
			this.getall();
		},
		methods: {
			getall(){
				let that  = this;
				that.$questions.getQuestionsClassify({}).then(res=>{
					that.list = res.data.list;
					console.log(res);
				})
			},
			urlClick(e){
				uni.navigateTo({
					url:e
				})
			}
		}
	}
</script>

<style lang="less">
	.tab {
		width: 690rpx;
		margin: auto;
		display: flex;
		// justify-content: center;
		flex-wrap: wrap;
		.tab-view {
			color: #333;
			width: 152rpx;
			margin-left: 10rpx;
			margin-right: 10rpx;
			text-align: center;
			margin-bottom: 10rpx;
			image {
				display: block;
				width: 76rpx;
				height: 76rpx;
				margin: auto;
			}
			view {
				font-size: 28rpx;
				line-height: 60rpx;
			}
		}
		
	}
</style>